<!DOCTYPE html>
<html>
<head>
    <include file="Public/head" />
    <link rel="stylesheet" href="__PUBLIC__/Manage/css/table.css">
    <script src="__PUBLIC__/Manage/js/wangEditor/wangEditor.min.js"></script>
    <title>新增与编辑商品</title>
</head>
<body>
<div class="nestable">
    <div class="console-title console-title-border drds-detail-title clearfix">
        <h5>新增与编辑商品</h5>
    </div>
    <div class="public-selectArea public-selectArea1">
        <form action="{:U('Product/save')}" method="post">
            <input type="hidden" value="{$id}" name="id">
            <div class="clearfix">
                <div class="wp_box  col-xs-8">
                    <dl>
                        <dt>产品名称：</dt>
                        <dd>
                            <input type="text" name="name" value="{$product.name}">
                        </dd>
                    </dl>
                </div>
            </div>
            <div class="clearfix">
                <div class="wp_box  col-xs-8">
                    <dl>
                        <dt>简介：</dt>
                        <dd>
                            <textarea name="content" value="{$product.content}" id="" cols="30" rows="10"></textarea>
                        </dd>
                    </dl>
                </div>
            </div>
            <div class="clearfix">
                <div class="wp_box  col-xs-8">
                    <dl>
                        <dt>Wechat地址：</dt>
                        <dd>
                            <input type="text" name="wechat_url" value="{$product.wechat_url}">
                        </dd>
                    </dl>
                </div>
            </div>

            <div class="clearfix">
                <div class="wp_box  col-xs-8">
                    <dl>
                        <dt>Alipay地址：</dt>
                        <dd>
                            <input type="text" name="alipay_url" value="{$product.alipay_url}">
                        </dd>
                    </dl>
                </div>
            </div>

            <div class="clearfix">
                <div class="wp_box  col-xs-8">
                    <dl>
                        <dt>价格：</dt>
                        <dd>
                            <input type="number" name="price" value="{$product.price}">
                        </dd>
                    </dl>
                </div>
            </div>

            <div class="btnArea">
                <a href="javascript:;" class="btn btn-sereachBg" id="submitBtn">
                    <span class="public-label">提交</span>
                </a>
            </div>
        </form>
    </div>
</div>
</body>
<script>
    $(function(){
        $("#submitBtn").on('click',function(){
            cvphp.submit($("form"),function(data){
                console.log(data)
                if(data.status!=1){
                    layer.msg(data.info);
                }else{
                    layer.msg('编辑成功');
                    setTimeout(function(){
                        window.location.href="{:U('Product/index')}";
                    },2000);
                }
            });
        });
    });
</script>
</html>